package org.rockyang.shardingjdbc.mybatisplus.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.rockyang.shardingjdbc.mybatisplus.common.mapper.OrderMapper;
import org.rockyang.shardingjdbc.mybatisplus.common.model.Order;
import org.rockyang.shardingjdbc.mybatisplus.common.service.IOrderService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhenwq
 * @since 2023-05-05
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService {

    @Override
    public Integer add(Order order) {
        return baseMapper.insert(order);
    }

    @Override
    public List<Order> selectAll() {
        LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
        return baseMapper.selectList(queryWrapper);
    }
}
